/**
 * @Copyright:Copyright (c) 1992 - 2015
 * @Company: TengTong
 */
package com.tengtong.duang.commons.convert;

/**
 * 转换异常
 *
 * @author Jai
 * @since: v1.0
 */
public class ConversionException extends RuntimeException {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * @param string
	 */
	public ConversionException(String message) {
		super(message);
	}

	/**
	 * @param sourceType
	 * @param targetType
	 * @param object
	 * @param illegalArgumentException
	 */
	public ConversionException(
			Class<?> sourceType, 
			Class<?> targetType, 
			Object value, Exception exception) {
		super("Unable to convert value \"" + (value == null? "null": value.toString()) + "\" from type '" +
				sourceType.getName() + "' to type '" + targetType.getName() + "'", exception);
	}

}
